{% extends 'base.html' %}
{% load staticfiles %}


{% block css %}
    <link href="{% static 'editor/css/froala_style.css' %}" rel="stylesheet">
    <link href="{% static 'editor/css/froala_editor.pkgd.min.css' %}" rel="stylesheet">{% endblock %}

{% block content %}


<div class="container">
	<div class="row">
		<div class="span12">
			<h3 class="text-center">
				vip工具箱
			</h3>
		</div>
	</div>
	<div class="row">
		<div class="col-lg-3 col-md-3 col-sm-12 col-xs-12" style="margin-top: 30px">
			 <a class="btn btn-lg btn-block btn-warning " href='{% url 'makevip' %}'>新浪博客内容编辑器</a>
		</div>
		<div class="col-lg-3 col-md-3 col-sm-12 col-xs-12" style="margin-top: 30px">
			 <a class="btn btn-lg btn-block btn-danger" href="{% url 'ewm' %}">查券客服单页</a>
		</div>
		<div class="col-lg-3 col-md-3 col-sm-12 col-xs-12" style="margin-top: 30px">
			 <a class="btn btn-lg btn-block btn-danger" href="{% url 'tbpinglun' %}">小猪猪淘宝评论生成系统</a>
		</div>
		<div class="col-lg-3 col-md-3 col-sm-12 col-xs-12" style="margin-top: 30px">
			 <a class="btn btn-lg btn-block btn-primary" href="{% url 'tbpinglun' %}">小猫猫淘宝评论生成系统</a>
		</div>
		<div class="col-lg-3 col-md-3 col-sm-12 col-xs-12" style="margin-top: 30px">
			 <a class="btn btn-lg btn-block btn-success" href="{% url 'admin123' %}">蜘蛛访问记录查询</a>
		</div>
		<div class="col-lg-3 col-md-3 col-sm-12 col-xs-12" style="margin-top: 30px">
			 <a class="btn btn-lg btn-block btn-success " href="{% url 'initedit' %}">froala功能实验室</a>
		</div>
	</div>

</div>







{% endblock %}

{% block script %}
    <script type="text/javascript">
        /**
         * 复制内容到粘贴板
         * content : 需要复制的内容
         * message : 复制完后的提示，不传则默认提示"复制成功"
         */
        {#    <h1>点击复制通用功能</h1>#}
        {#    <a href="https://blog.csdn.net/sunnyzyq/article/details/85065022">参考链接</a>#}
        function copyinfo() {
{#            aaa = $('#edit').froalaEditor('html.get', true);#}
            console.log(editor.html.get());
            copycontent = editor.html.get();
            aux = document.createElement("input");
            aux.setAttribute("value", copycontent);
            document.body.appendChild(aux);
            aux.select();
            document.execCommand("copy");
            document.body.removeChild(aux);
        }
        function copyToClip(content, message) {
            aux = document.createElement("input");
            aux.setAttribute("value", content);
            document.body.appendChild(aux);
            aux.select();
            document.execCommand("copy");
            document.body.removeChild(aux);
            if (message = null) {
                alert("不成功");

            } else {
                {#                        alert(message);#}
                abc = document.getElementById('getid');

                abc.setAttribute('value', content);
                {#                window.location.href = "http://www.tbzhu.com/vip";#}

            }
        }

    </script>


    {#文本编辑框插件开始#}
    <script src="{% static 'editor/js/froala_editor.pkgd.min.js' %}"></script>
    <script src="{% static 'editor/js/languages/zh_cn.js' %}"></script>
    <script src="{% static 'editor/js/plugins/font_family.min.js' %}"></script>

    <script>

        {#        插入#}
        FroalaEditor.DefineIcon('insertHTML', {NAME: 'plus', SVG_KEY: 'add'});
        FroalaEditor.RegisterCommand('insertHTML', {
            title: '插入段落',
            focus: true,
            undo: true,
            refreshAfterCallback: true,
            callback: function () {
                this.html.insert('222这个是你要插入的段落,支持代码<img src="{% static 'img/logo.png' %}">');
                this.undo.saveStep();
            }
        });
        FroalaEditor.DefineIcon('insertHTML', {NAME: 'plus', SVG_KEY: 'add'});
        FroalaEditor.RegisterCommand('插入自定义信息代码', {
            title: '插入代码',
            focus: true,
            undo: true,
            refreshAfterCallback: true,
            callback: function () {
                this.html.insert('<p style="text-align: center;">如何使用这个呢<img src="{% static 'img/logo.png' %}"></p>');
                this.undo.saveStep();
            }
        });

        FroalaEditor.DefineIcon('clear', {NAME: 'remove', SVG_KEY: 'remove'});
        FroalaEditor.RegisterCommand('clear', {
            title: 'Clear HTML',
            focus: false,
            undo: true,
            refreshAfterCallback: true,
            callback: function () {
                this.html.set('');
                this.events.focus();
            }
        });

        editor = new FroalaEditor('div#froala-editor', {
                heightMin: 200,
                heightMax: 500,
                language: 'zh_cn',

            toolbarButtons: [
                ['bold', 'italic', 'underline', 'backgroundColor', 'emoticons','','paragraphFormat', 'align','formatOL', 'formatUL'],
                [ 'fontFamily','fontSize','textColor','backgroundColor'],
                ['insertHTML', 'undo', 'redo','clear'],
                ['插入自定义信息代码', 'undo', 'redo', 'html','clear']
            ]
        })
    </script>
    {#文本编辑框插件结束#}



{% endblock %}